package com.bruce.learnrecycler.kotlin.model.shjt.getline;

import com.bruce.commonutils.ToStringUtils;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Path;
import org.simpleframework.xml.Root;

import java.util.List;

/**
 * Created by Bruce-Home on 2015/8/23.
 */
@Root(strict = false)
public class LineInfoDetail {
    @ElementList(inline = true)
    @Path(value = "lineResults0")
    private List<Stop> stops0;

    @Element(name = "direction")
    @Path(value = "lineResults0")
    private boolean direction0;

    @ElementList(inline = true)
    @Path(value = "lineResults1")
    private List<Stop> stops1;

    @Element(name = "direction")
    @Path(value = "lineResults1")
    private boolean direction1;

    public List<Stop> getStops0() {
        return stops0;
    }

    public void setStops0(List<Stop> stops0) {
        this.stops0 = stops0;
    }

    public boolean getDirection0() {
        return direction0;
    }

    public void setDirection0(boolean direction0) {
        this.direction0 = direction0;
    }

    public List<Stop> getStops1() {
        return stops1;
    }

    public void setStops1(List<Stop> stops1) {
        this.stops1 = stops1;
    }

    public boolean getDirection1() {
        return direction1;
    }

    public void setDirection1(boolean direction1) {
        this.direction1 = direction1;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("direction0: ").append(direction0);
        for (Stop stop : stops0) {
            builder.append("\n").append(ToStringUtils.newString(stop));
        }
        builder.append("direction1: ").append(direction1);
        for (Stop stop : stops1) {
            builder.append("\n").append(ToStringUtils.newString(stop));
        }
        return builder.toString();
    }

    public String lineId;
}
